<template>
    <div class="goodsdesc-container">
        <h3 class="title">{{ info.title }}</h3>
        <hr>
        <div class="content" v-html="info.content"></div>
    </div>
</template>

<script>
// 按需导入mint-ui 组件
import { Toast } from "mint-ui";

export default {
    data(){
        return{
            info:{},   //商品的描述信息
        };
    },
    created() {
        this.getGoodsDesc();
    },
    methods:{
        getGoodsDesc(){
                  this.$http.get("api/goods/getdesc/" + this.id).then(result => {
        // console.log(result.body);
        if (result.body.status === 0) {
          // 成功了
          this.info = result.body.message[0];
        } else {
          // 失败的
          Toast("加载商品列表失败！");
        }
      });
        }
    },
    props:['id']
}
</script>

<style lang="scss">
.goodsdesc-container{
     .title{
        font-size: 16px;
        margin: 10px 0;
        color: blue;
        text-align: center;
    }
    .content{
        img{
            width: 100%;
            
        }
    }
}
   
</style>